-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
std.Build.Watch: key fanotify file descriptors by mount id #24113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Since marks are limited to a single filesystem. Context: ziglang#20670 Original pull request: ziglang#20672 Co-authored-by: Maciej 'vesim' Kuliński <vesim809@pm.me>
Nice work, thanks! |
I’m still getting the error because it re-mounts
|
(I'm out for the next few weeks so I won't be able to take a closer look for now.) I'm not sure I understand your setup with the information you've pasted. Do I understand correctly that your source files are under |
How do I see the mount ID for a mountpoint? |
Ah, after reading the manual:
So the bind-mount has a different MountID |
The error description of
But I think it gets thrown because I’m using btrfs, and as always btrfs is a special little snowflake when it comes to syscall behaviour on Linux. Maybe a solution here could be to create a different watch group? |
I think I figured it out; I wasn’t aware that SO I think the way to do this is to catch that EXDEV error and provide an error message that includes a hint, or alternatively fall back to the |
If it helps to pinpoint the root cause on your side, I've tested this patch with Zig's stdlib in the Nix store on its own Btrfs subvolume and my project's source directory on another Btrfs subvolume, and, IIRC, under Linux 6.15. That's why I asked about your setup because yours doesn't seem to actually involve multiple filesystems so it's a bit confusing you're hitting this error (it might not even be necessary to key by mount id since it seems to be the same underlying filesystem in your case).
is fair since there's already a precedent: Line 187 in 0cb558b
|
Okay, so, I updated to a newer kernel and now the fanotify watch works as expected. |
I hope it's okay to take over the inactive pull request #20672. The patch is very similar but I've taken into account the review comments: since indices correspond between the 'public'
DirTable
and 'private' (to the Linux implementation)HandleTable
I've stashed the mount point information in there. However, the Windows implementation is quite similar and sharesmarkAllFilesDirty
so I had to add a small edge case, not sure what you'll think of it.I've been using Zig for the past two weeks so apologies if I'm not following conventions. I've tested my change by following the wiki and since I'm on NixOS I'm hitting this problem immediately (same error message as #20670).
Fixes #20670.
Closes #20672.